#include "../../include/mysql_tool.h"
int mysql_tool::log_query(string user_name, string user_pwd)
{
    string query = "select * from user where user_name='' and user_password='';";
    query.insert(36, user_name);
    query.insert(57 + user_name.size(), user_pwd);
    if (!mysql_query(&mysql, query.c_str()))
    {

    }
    else
    {
        cout << "sql语句执行失败" << endl;
    }
    MYSQL_RES *result = mysql_store_result(&mysql);
    int num;
    num = mysql_num_rows(result); 
    mysql_free_result(result);
    if (num != 0)
    {
        return 1;
    }
    else
    {
        cout << "查找失败,用户登录失败" << endl;
        return 0;
    }
    return 0;
}